<?php

/**
 * @author christian
 * @copyright 2011
 * @abstract carga de todo el itinerario que es parte de un tour del itenario del tour
 */
 
 

$ruta=$_SERVER['DOCUMENT_ROOT']."/viventura"."/MDOperator";
include_once("$ruta/conf/CConfig.php");
include_once("$ruta/elements/head.tpl");
include_once("$ruta/MDItinerary/MDEItineraryDraw.php");
include_once("$ruta/MDItinerary/MDItineraryEditDraw.php");
include_once("$ruta/MDOperatorGeneral/CDrawPageReg.php");
include_once("$ruta/MDOperatorGeneral/CTourEditDraw.php");

include_once("$ruta/view/CDrawMenuTour.php");
include_once("$ruta/star.php");


$idPackTour=$_GET['codigo']; // El código que recibe aqui es el código del tour
$idTour = CTourEditDraw::getInstance()->getAnyId("pack_has_tour","idPackTour",$idPackTour,"TOUR_idTour");


/** Gestionar desplazamiento de fechas desde tour */

echo "<div id='dashboard_info'>";
$ahead_behind=array("move"=>"Mover inicio a");
CDrawPageReg::getInstance()->DrawTextBox($ahead_behind);
echo "<p align='right'>";
MDItineraryEditDraw::getInstance()->DrawSubmmit("Ejecutar");
echo "</p>";
echo "</div>";

CDrawMenuTour::getInstance()->DrawDivAdBegin();


MDItineraryEditDraw::getInstance()->DrawFoot();

/** Dibuja tabla de itinerarios ordenados por fechas*/

$title="Itinerario del tour ". "$idTour";

$maintable="tour_has_track"; //se pasa el id de la tabla que relaciona track y tour
$growtable="track";
$columnas=array("idTourTrack"=>"idTourTrack","DateBegTrack"=>"Inicio","DateEndTrack"=>"Fin","OriTrack"=>"Origen","IntTrack"=>"Intermedio","DestTrack"=>"Destino");


MDEItineraryDraw::getInstance()->DrawTable($title,$maintable,$growtable,$columnas,$idTour);

/** Seleccionar posicion de insercion del track dentro del tour*/
$action="MDItineraryTemp.php";$name="formulario_registro";$method="post";$NAME="Insertar track dentro del tour en: ";
MDItineraryEditDraw::getInstance()->DrawHead($action,$name,$method,$NAME);

/// Formulario reorder
MDItineraryEditDraw::getInstance()->HiddenValue($idTour, "idTour");



CDrawMenuTour::getInstance()->DrawDivAdEnd();

echo "<div id='dashboard_info'>";
$place_i = array("Al inicio"=>"0","Al final"=>"1","Despues de: "=>"2");
MDItineraryEditDraw::getInstance()->DrawRadioButton($place_i,"place_i");
//Lista de extensiones
MDItineraryEditDraw::getInstance()->DrawSelectItinerary($idTour);
echo "<p align='right'>";
MDItineraryEditDraw::getInstance()->DrawSubmmit("Continuar");
echo "</p>";
echo "</div>";
// Fin de formulario

?>